<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>文章管理</title>
    <meta name="keywords" content="文章管理">
    <meta name="description" content="文章管理">
    <link rel="shortcut icon" href="favicon.ico"> <link href="__PUBLIC__/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="__PUBLIC__/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/css/animate.min.css" rel="stylesheet">
    <link href="__PUBLIC__/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <!--<link rel="stylesheet" href="__PUBLIC__/zixun/css/article.css" type="text/css" media="screen" />-->
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h4>文章管理</h4><br>
                    <h5>
                        <a href="__CONTROLLER__/addNews" title="添加文章">
                            <button type="button" class="btn btn-primary">+添加文章</button></a>

                    </h5>
                    <input name="keyword" value="{$keyword}" placeholder="请输入文章标题" class="form-control"  style="width: 66%;display: inline;margin-left: 8px;margin-right: 8px;" />
                    <button type="button" class="btn btn-primary" onClick="sou()">搜索</button>
                </div>
                <div class="ibox-content" style="padding-bottom: 30px;">
                    <table class="table table-bordered">
                        <thead>
                            <tr>
                                <th>ID</th>
                                <th>标题</th>
                                <th>关键字</th>
                                <th>分类名称</th>
                                <th>真实阅读量</th>
                                <th>总阅读量</th>
                                <th>添加时间</th>
                                <th>操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list" id="vo">
                            <tr  class="gradeX">
                                <td>{$vo.id}</td>
                                <td>{$vo.title}</td>
                                <td>{$vo.keywords}</td>
                                <td>{$vo.cate_name}</td>
                                <td>{$vo.view}</td>
                                <td>{$vo.click}</td>
                                <td>{$vo['addtime']|date="Y-m-d H:i",###}</td>
                                <td>
                                    <a href="__CONTROLLER__/editNews/id/{$vo.id}" style="padding:0 3px;" title="编辑">
                                        <i class="glyphicon glyphicon-pencil"></i>
                                    </a>
                                    <a href="javascript:;" style="padding:0 3px;" class="js_del" data-id="{$vo.id}" title="删除">
                                        <i class="glyphicon glyphicon-trash"></i>
                                    </a>
                                </td>
                            </tr>
                            </volist>
                        </tbody>
                    </table>
                    <!--分页-->
                    <div class="page">
                        {$page}
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>
<script src="__PUBLIC__/js/jquery.min.js?v=2.1.4"></script>
<script src="__PUBLIC__/js/bootstrap.min.js?v=3.3.6"></script>
<script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__PUBLIC__/js/content.min.js?v=1.0.0"></script>
<script src="__PUBLIC__/js/plugins/iCheck/icheck.min.js"></script>
<script src="__PUBLIC__/js/demo/peity-demo.min.js"></script>
<script src="__PUBLIC__/js/layer/layer.js"></script>

<style type="text/css">
    .page{ padding-top:10px;text-align: center}
    .page a{ display:inline-block; width:50px; height:30px; border:1px #999 solid; border-radius:5px; margin-right:16px;text-align:center; line-height:30px; font-size:14px; color:#333;}
    .page a:last-child{ margin-right:0; }

</style>

<script>
    //删除
    $(".js_del").click(function () {
        var id = $(this).attr('data-id');
        var i = layer.load();
        var this_a = $(this);
        $.post('__CONTROLLER__/del/',{id:id},function(e){
            layer.close(i);
            if(e.status==1){
                this_a.parent().parent(".gradeX").remove();
                // window.location.reload();
            }else{
                layer.msg(e.msg,{icon:2});
            }
        });

    })

    function sou(){
        window.location.href="__CONTROLLER__/index/?keyword="+$("input[name='keyword']").val();
    }//end fun
</script>

</body>
</html>
